/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ListPersons.java
 *
 * Created on Jul 13, 2011, 1:11:09 PM
 */
package panels;

import conn.EMIS4Connection;
import dao.PersonDao;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.management.relation.Role;
import obj.Person;

/**
 *
 * @author cjlopez
 */
public class ListPersons extends javax.swing.JPanel {
    
    EMIS4Connection database = EMIS4Connection.getInstance();
    Connection conn = database.getConnection();
    PersonDao personDao = new PersonDao();
    List<Person> persons = null;

    /** Creates new form ListPersons */
    public ListPersons() {
        initComponents();
    }
    
//    public String[][] MakeTable() {
//        //** Create Role ComboBox Content
//        try {
//            persons = personDao.loadAll(conn);
//        } catch (SQLException ex) {
//            Logger.getLogger(SearchPersonPanel.class.getName()).log(Level.SEVERE, null, ex);
//        }
//        Iterator<Person> personIt = persons.iterator();
//        int x = 0;
//        while(personIt.hasNext())
//        return null;
//    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new javax.swing.JTable();

    jScrollPane1.setName("jScrollPane1"); // NOI18N

    jTable1.setModel(new javax.swing.table.DefaultTableModel(
      new Object [][] {
        {null, null, null, null},
        {null, null, null, null},
        {null, null, null, null},
        {null, null, null, null}
      },
      new String [] {
        "Title 1", "Title 2", "Title 3", "Title 4"
      }
    ));
    jTable1.setName("jTable1"); // NOI18N
    jScrollPane1.setViewportView(jTable1);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(12, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 357, Short.MAX_VALUE)
        .addContainerGap())
    );
  }// </editor-fold>//GEN-END:initComponents
  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JScrollPane jScrollPane1;
  private javax.swing.JTable jTable1;
  // End of variables declaration//GEN-END:variables
}
